package com.yootk.event;

import com.yootk.vo.Message;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEvent;

/**
 * 自定义事件类
 */
@Slf4j
@Getter
public class YootkEvent extends ApplicationEvent {
    private Message message;    // 数据保存

    public YootkEvent(Object source, Message message) {
        super(source);
        this.message = message;     // 数据存储
    }

    // 自定义方法
    public void fire() {
        log.info("message = {}", this.message);
    }
}
